A Denotational Semantics for Prolog

نویسندگان

  • Fausto Spoto
  • Giorgio Levi
چکیده

analysis is nite, which was not the case in our previous proposal [13]. The overheadneeded for reaching an improved precision essentially consists in the use of observability andkernel constraints and of their success and failure conditions.We can now consider the already mentioned paper [11]. A big di erence arises lookingfor instance at the way they handle clause composition and the cut. Their de nitions arethe following ones.Consider two sequences S1 and S2 without cut information. S1 stands for theresult of ci and S2 stands for the (combined) result of ci+1; : : : ; cn. If executionof ci terminates, then su x ci+1; : : : ; cn is executed. Otherwise ci+1; : : : ; cn isnot executed. Therefore, the combined result S1 S2 = S1 :: S2 if S1 is nite (i.e.neither incomplete nor in nite) and S1 S2 = S1 otherwise. The de nition canbe extended to sequences with cut information. If no cut is executed in ci (...),the previous reasoning applies. Otherwise, su x ci+1; : : : ; cn is not executed (...).So, the combined result (...) is de ned by hS1; cfi S2 = S1 S2 if cf = nocutand hS1; cfi S2 = S1 if cf = cut.Compare this with our de nitions 10 and 11. The di erence is that we delay the decisiondivergence/no divergence or cut/no cut to the actual evaluation of the denotation in a givenconstraint store. They take instead this decision just when they compose the denotations.It is not clear how their approach could lead to a goal-independent denotation. In any casetheir approach makes impossible to compute the denotations of the most general goals only,like we do in this paper. This is important because it leads to a simpler and more e cientcomputation of the semantics.While a general approach for de ning success and failure conditions is available (equations1 and 2), one should not think that the problem of nding success and failure conditionsis de nitely solved. Actually, we only shifted the problem in the de nition of the abstractdomain, which must be devised in such a way that equations 1 and 2 do not give trivialapproximations (like >, for instance). Future work will be spent in devising such domains,and in showing the feasibility of the approach with its implementation.References[1] R. Barbuti, M. Codish, R. Giacobazzi, and G. Levi. Modelling Prolog Control. Journal of Logic andComputation, 3:579{603, 1993.[2] R. Barbuti, M. Codish, R. Giacobazzi, and M. Maher. Oracle Semantics for PROLOG. Informationand Computation, 1995.[3] E. Borger. A Logical Operational Semantics of Full Prolog. In E. Borger, H. Kleine, H. Buning, andM. Richter, editors, CSL 89. 3rd workshop on Computer Science Logic, volume 440 of Lecture Notesin Computer Science, pages 36{64. Springer-Verlag, 1990.[4] A. Bossi, M. Bugliesi, and M. Fabris. Fixpoint Semantics for PROLOG. In D. S. Warren, editor, Proc.Tenth Int'l Conf. on Logic Programming, pages 374{389. The MIT Press, 1993.[5] P. Cousot and R. Cousot. Abstract Interpretation and Applications to Logic Programs. Journal ofLogic Programming, 13(2 & 3):103{179, 1992.[6] A. de Bruin and E. de Vink. Continuation Semantics for Prolog with Cut. In J. Diaz and F. Orejas,editors, Proc. CAAP 89, volume 351 of Lecture Notes in Computer Science, pages 178{192. Springer-Verlag, 1989.[7] S. K. Debray and P. Mishra. Denotational and Operational Semantics for Prolog. Journal of LogicProgramming, 5:61{91, 1988.[8] Melvin Fitting. A Deterministic Prolog Fixpoint Semantics. Journal of Logic Programming, 2(2):111{118, 1985.[9] D. Jacobs and A. Langen. Static Analysis of Logic Programs for Independent AND Parallelism. Journalof Logic Programming, 13(2 & 3):291{314, 1992.[10] N. D. Jones and A. Mycroft. Stepwise Development of Operational and Denotational Semantics forPROLOG. In StenAke Tarnlund, editor, Proc. Second Int'l Conf. on Logic Programming, pages281{288, 1984.[11] B. Le Charlier, Rossi S., and P. Van Hentenryck. An Abstract Interpretation Framework which Accu-rately Handles PROLOG Search Rule and the Cut. In M. Bruynooghe, editor, Proceedings of the 1994Int'l Symposium on Logic Programming, pages 157{171. The MIT Press, 1994.[12] G. Levi and D. Micciancio. Analysis of pure PROLOG programs. In M.I. Sessa, editor, ProceedingsGULP-PRODE '95, 1995 Joint Conference on Declarative Programming, pages 521{532, 1995.[13] G. Levi and F. Spoto. Accurate Analysis of Prolog with Cut. In P. Lucio, M. Martelli, and M. Navarro,editors, Proceeding APPIA-GULP-PRODE'96, pages 481{492, 1996.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Continuation Semantics for PROLOG with Cut

We present a denotational continuation semantics for Prolog with cut. First a uniform language B is studied, which captures the control flow aspects of Prolog. The denotational semantics for B is proven equivalent to a transition system based operational semantics. The congruence proof relies on the representation of the operational semantics as a chain of approximations and on a convenient ind...

متن کامل

Denotational and Operational Semantics for Prolog

The semantics of Prolog programs is usually given in terms of the model theory of first order logic. However, this does not adequately characterize the computational behavior of Prolog programs. Prolog implementations typically use a sequential evaluation strategy based on the textual order of clauses and literals in a program, as well as non-logical features like ‘‘cut’’. In this work we devel...

متن کامل

Dealing with Explicit Exceptions in Prolog

Existing logic languages provide some simple "extra-logical" constructs for control manipulation , such as the cut of standard Prolog and the exception handling constructs of other versions of Prolog (e.g. SICStus Prolog). Aspects speciically concerning the ow of control in a language can be quite naturally modelled by means of the Denotational Semantics, and in particular the Denotational Sema...

متن کامل

On Rewrite Programs: Semantics and Relationship with Prolog

Rewrite programs are logic programs represented as rewrite rules, whose execution mechanism usually employs some version of Knuth-Bendix type completion. Rewrite programs allow one to express mutually exclusively defined predicates as well as those which are not. In this paper we demonstrate that rewrite programs, although denotationally equivalent to Prolog on the ground level, may produce few...

متن کامل

We Present an Operational Model O and a Continuation Based Denotational Model D for a Section 1 Introduction

uniform variant of Prolog, including the cut operator. The two semantical definitions make use of higher order transformations Φ and Ψ, respectively. We prove O and D equivalent in a novel way by comparing yet another pair of higher order transformations Φ ˜ and Ψ ˜ , that yield Φ and Ψ, respectively , by application of a suitable abstraction operator. In [BV] we presented both an operational a...

متن کامل

Comparative Metric Semantics for Commit in OR-Parallel Logic Programming

For the control ow kernel of or-parallel Prolog with commit an operational and a denotational model are constructed and related using techniques from metric semantics. By maintaining explicit scope information a compositional handling of the commit for the denotational model is established. By application of an abstraction function, which deletes this extra information, the operational semantic...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1997